<?php
/**
 * 文件 : ChiefController.class.php
 * 作者 : David
 * 日期 : 2015/5/20
 * 备注 : 申诉管理
 */
namespace Admin\Controller;

use Think\Controller;

class AppealController extends Controller {

    /**
     * 申诉列表
     */
    
    public function Appeallist(){
    		$Appeal = D("Appeal");
    		$p = I('post.pageNum', '1', 'intval');
	    	$everypage  = 3; // 每页显示的数量
	    	$start = $p > 1 ? (($p - 1) * $everypage) : 0;
    	if(IS_GET){
	    	$count = $Appeal->where($map)->count();
    		$Appealdata=$Appeal->order("id desc")->limit($start . ',' . $everypage)->select();
    	}else{
    		$appeal_status = I('post.appeal_status');
    		$appeal = I('post.appeal');
            $status = I('post.status');
    		$appeal_a = I('post.appeal_a');
	        $startdate = I('post.startdate');
	        $enddate = I('post.enddate');
	        if (($startdate && empty($enddate)) || (empty($startdate) && $enddate)) {
	            AjaxReturn(300, '请把起始时间与结束时间选择完整');
	        }
       		if ($startdate && $enddate) {
	           	if ($startdate > $enddate) {
	                AjaxReturn(300, '起始时间不能大于结束时间');
	            } 
	            $map['addtime'] = array(
	                array('egt', strtotime($startdate)),
	                array('elt', strtotime($enddate)),
	            );
       		}
       	
    		if($appeal_status){
    			$map['roletype']=$appeal_status;
    		}
    		if($appeal){
    			$map['appealtype']=$appeal;
    		}
  
    		$count = $Appeal->where($map)->count();
	    	$Appealdata=$Appeal->where($map)->order("id desc")->select();	
    	}

	    	$count = $Appeal->where($map)->count();
	    	$Appealdata=$Appeal->where($map)->order("id desc")->select();	
    	}
    	$this->assign('nowpage', $p);
	    $this->assign('pageNumShown', ceil($count/$everypage));
	    $this->assign('currentPage', $p);
	    $this->assign('numPerPage', $everypage);

	    );
	    $this->assign('enddate', $enddate);
    	$this->assign('Appealdata',$Appealdata);
    $this->assign('startdate', $startdate);
       $this->assign('enddate', $enddate);
   		$this->display();
    }
if ($startd && $eate) {
	           	if ($startdate > $enddate) {
	                AjaxReturn(300, '起始时间不能大于结束时间');
	            } 
	         
       		}

我修复了一个我败给对我的文问问档11111111111111111
我修复了5bug
计划经济积极急急急

   }